<template>
    <view>
		<view class="head">
			<view class="head_left" @tap="back()">
				<image src="../../../static/wode/return.png" mode=""></image>
				<text>返回</text>
			</view>
			<view class="head_mid">
				我的母语
			</view>
			<view class="head_right">
				完成({{chooseNumStr.length}})
			</view>
		</view>
		<view class="search" @tap="">
			<image src="../../../static/jingjie/search.png" mode=""></image>
			<text>搜索</text>
		</view>
        <!-- <SortPickerList ref="sortPickerList" @clickData="clickData"></SortPickerList> -->
    </view>
</template>
<script>
    // import SortPickerList from "@/components/nickro-sortPickerList.vue"
    export default {
        name:"contury",
        // components: {SortPickerList},
        data() {
            return {
				chooseNumStr:[],
				arr:[],
                dataArr: [
                    { name: '中国', value: 'China'},
                    { name: '俄罗斯', value: 'Russia' },
                    { name: '美国', value: 'America' },
                    { name: '澳大利亚', value: 'Australia' },
                    { name: '巴西', value: 'Brazil' },
                    { name: '韩国', value: 'Korea' },
                    { name: '朝鲜', value: 'North Korea' },
                    { name: '英国', value: 'Britain' },
                    { name: '德国', value: 'Germany' },
                    { name: '加拿大', value: 'Canada' },
                    { name: '非洲', value: 'New Zealand' },
                ]
            }
        },
        onShow() {
            var that = this
            uni.setNavigationBarTitle({
                    title: '自动处理索引列表'
            });
        },
        onReady() {
            var that = this
            that.$refs["sortPickerList"].initPage(that.dataArr)
        },
        methods: {
            clickData(data) {
                console.log('获取名：' + data.label)
                console.log('获取值：' + data.value)
				var str=this.arr
				str.push(data.label)
				var map={}
				for(var i = 0;i<str.length;i++){
					var s = str[i];
					var r = map[s];
					if(r){
						map[s] =Math.floor(map[s]/2);

					}else{
						map[s] = 1;
						Math.ceil(map[s])
					}
				}
				console.log(map)
				
				console.log(str)
            }
        }
    }
</script>

<style scoped>
	.head {
		width: 100%;
		display: flex;
		justify-content: space-between;
		height: 128upx;
		background: #ffffff;
		padding: 0 24upx;
		z-index: 200;
	}

	.head image {
		width: 20upx;
		height: 36upx;
		margin-right: 9upx;
	}

	.head_left {
		height: 82upx;
		width: 106upx;
		display: flex;
		align-items: center;
		line-height: 82upx;
		color: #666666;
		font-size: 32upx;

	}

	.head_right {
		width: 150upx;
	}
	.search {
		margin: 0 auto;
		margin-top: 20upx;
		background: #FFFFFF;
		border: 1upx solid #E6E6E6;
		border-radius: 64upx;
		width: 702upx;
		height: 64upx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28upx;
		color: #999999;
		margin-bottom: 20upx;
	}
	
	.search image {
		height: 28upx;
		width: 28upx;
		margin-right: 10upx;
	}
</style>